import axios from 'axios'
const ajax = axios.create()

let loadingInstance = null;
ajax.interceptors.request.use(config=>{
  // 创建loading的实例
  loadingInstance = Loading.service({

    lock: true,
    text: 'Loading',
    spinner: 'el-icon-loading',
    background: 'rgba(0, 0, 0, 0.7)'

  })
  return config
})

ajax.interceptors.response.use(resp=>{
  loadingInstance.close();
  return resp;
  })

  // 登录
export const postLogin = (loginInfo)=>{
  return ajax.post('/app/mock/166199/example/1555989660167',loginInfo)
}
